Skip to content

feat(action): JS Action for uses: intentius/github-warden@v1 - #3

Merged
lex00 merged 1 commit into
mainfrom
feat/js-action
Jun 19, 2026
Merged

lex00 merged 1 commit into
mainfrom
feat/js-action

Conversation

@lex00

@lex00 lex00 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds action.yml at repo root: node20 JS Action with 9 inputs (command, config, mode, cycles, app-id, installation-id, private-key, fail-on, allow-guardrail-override)
  • src/action.ts: reads INPUT_* env vars, maps to CLI argv, calls the existing run() export — no net-new auth code, passes private-key through GOVERNANCE_APP_PRIVATE_KEY for the existing CLI path
  • action/index.mjs: committed esbuild bundle (the file Actions runners execute); NOT in .gitignore
  • cli.ts: one-line guard change — skips self-invoke when GITHUB_WARDEN_IS_ACTION is set; esbuild --define statically resolves this to false in the action bundle so the guard is dead code
  • build:action script in package.json
  • CI staleness step: npm run build:action && git diff --exit-code action/index.mjs
  • src/action.test.ts: 11 tests covering input→argv mapping for reconcile dry-run, reconcile apply+cycles, audit+fail-on, allow-guardrail-override, and required-input validation
  • README: "Use as a GitHub Action" section with reconcile dry-run (PR), reconcile apply (push to main), and audit examples

Test plan

  • CI check job passes (typecheck + tests + staleness guard)
  • node action/index.mjs simulation: missing config input → exit 2 + clear message; audit with bad key → exit 3 from auth error (not a crash)
  • All 227 tests pass locally

🤖 Generated with Claude Code

- action.yml: 9 inputs (command, config, mode, cycles, app-id,
  installation-id, private-key, fail-on, allow-guardrail-override)
- src/action.ts: reads INPUT_* env vars, builds argv, calls run()
- action/index.mjs: committed esbuild bundle (node20 entrypoint)
- cli.ts: skip self-invoke guard when built into action bundle
  (GITHUB_WARDEN_IS_ACTION defined at build time via esbuild --define)
- build:action script in package.json
- CI staleness check: build:action + git diff --exit-code action/index.mjs
- src/action.test.ts: input→argv mapping + required-input validation
- README: uses: intentius/github-warden@v1 section
@lex00
lex00 merged commit 50db522 into main Jun 19, 2026
2 checks passed
@lex00
lex00 deleted the feat/js-action branch June 19, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant